package reflect;

import java.lang.reflect.Field;

public class ReflectDemo8 {
    public static void main(String[] args) throws Exception{
        Class cls =Class.forName("reflect.Teacher");
        Object obj =cls.newInstance();
        Field field = cls.getDeclaredField("name");
        field.set(obj,"李四");
        System.out.println(obj);
    }
}
